package com.suse.service.admin.edu.controller;

import com.suse.common.config.response.R;
import com.suse.service.admin.edu.service.SubjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

/**
 * <p>
 * 课程科目 前端控制器
 * </p>
 *
 * @author 辜玉彬
 * @since 2022-08-10
 */
@Api(tags = "课程分类接口")
@RestController
@RequestMapping("/subject")
public class SubjectController {

    @Resource
    private SubjectService subjectService;

    @ApiOperation(value = "导入课程分类文件")
    @PostMapping("/file/import")
    public R importSubjectFile(MultipartFile file) {
        return subjectService.importSubjectFile(file);
    }

    @ApiOperation(value = "导入课程分类文件")
    @PostMapping("/export")
    public R exportSbject() {
        return subjectService.exportSbject();
    }

    @ApiOperation(value = "获取课程分类树形表格(分页)")
    @PostMapping("/tree-table")
    public R getSubjectTreeTable() {
        return subjectService.getSubjectTreeTable();
    }

    @ApiOperation(value = "获取课程分类树形下拉列表(分页)")
    @PostMapping("/tree-select")
    public R getSubjectTreeSelect() {
        return subjectService.getSubjectTreeSelect();
    }

}

